package com.hanbang.taitaigou.ui.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/1/21.
 */
public abstract class BaseRecylclerAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {
    public static int VIEW_TYPE_CONTENT = 0;
    public static int VIEW_TYPE_TOP = 1;
    public static int VIEW_TYPE_BUTTTON = 2;
    public static int VIEW_TYPE_OTHER = 3;
    protected Context context;
    protected List<T> listDataS = null;
    public BaseViewHolder.OnItemClickListent onItemClickListener = null;
    private ArrayList<View> headerViews = new ArrayList<>();
    private ArrayList<View> footerViews = new ArrayList<>();

    public BaseRecylclerAdapter(Context context, List<T> listDataS) {
        this.context = context;
        this.listDataS = listDataS;
        setHasStableIds(true);
    }

    public void setOnItemClickListener(BaseViewHolder.OnItemClickListent onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }


    protected T getItemData(int position) {
        return listDataS.get(position);
    }

    @Override
    public int getItemCount() {
        return listDataS.size();
    }

    @Override
    public void onBindViewHolder(VH holder, int position) {

    }

    @Override
    public VH onCreateViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    public void addFooterView(View view) {

    }
}
